package com.demo;

/**
 * 懒汉(线程不安全)
 * @author ytj
 * @date 2022/2/21
 */
public class Single1 {
    private static Single1 instance;

    private Single1(){

    }

    public static Single1 getInstance(){
        if(instance!=null){
            return instance;
        }
        instance=new Single1();
        return instance;
    }
}
